// uno.config.ts
import { defineConfig, presetAttributify, presetUno } from 'unocss'

export default defineConfig({
  presets: [
    presetAttributify({ /* preset options */ }),
    presetUno({}),
    // https://unocss.dev/interactive/s
    // ...custom presets
  ],
  rules: [
    // your custom rules
    ['center', { display: "flex", "align-items": "center" }],
    ['flex-column', { display: "flex", "align-items": "center", "flex-direction": "column" }],
    [/([wh])-(\d+)p$/, ([_, match, num]) => {
      let prop = match === 'w' ? 'width' : 'height'
      return { [prop]: `${num}%` }
    }],
    [/f-size-(\d+)$/, ([_, num]) => {
      return { "font-size": `${num}rem` }
    }],
    [/overflow-([xy])-(\w+)$/, ([_, popsition, val]) => {
      return { [`overflow-${popsition}`]: val }
    }],
    ["overflow-y", { "overflow-y": "auto", "overflow-x": "hidden" }]
  ],
})
